package com.cetsk.android.talkorigins;

import android.app.SearchManager;
import android.content.Intent;
import android.os.Bundle;

public class SearchActivity extends ClaimsListActivity {
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
	    Intent intent = getIntent();
	    if (Intent.ACTION_SEARCH.equals(intent.getAction())) {
	      String query = intent.getStringExtra(SearchManager.QUERY);
	      doSearch(query);
	    }
	}
	public void doSearch(String query){
		ClaimAdapter ca = new ClaimAdapter(getBaseContext(), R.layout.list_item, ClaimHelper.searchClaims(this,query,true));
		setTitle("Search for '"+query+"'");
		getListView().setAdapter(ca);
	}
}